package com.chenyuxin.ilp.util;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class FilePathUtil {
    public static List<Long> getFolderId(String filePath) {
        if (filePath == null || filePath.isEmpty()) {
            return Collections.emptyList(); // 返回空列表
        }

        // 使用正则表达式匹配数字
        Pattern pattern = Pattern.compile("\\d+");
        Matcher matcher = pattern.matcher(filePath);

        List<Long> result = new ArrayList<>();
        while (matcher.find()) {
            result.add(Long.parseLong(matcher.group())); // 提取并转换为整数
        }
        return result;
    }
}
